package ArrayList;

import javax.imageio.stream.ImageInputStream;
import java.util.LinkedList;

public class Test1 {
    public static void main(String[] args) {
        LinkedList dog = new LinkedList();
        dog.add("ouou:Dog");
        dog.add("yaya:Dog");
        dog.addLast("meimei:Dog");
        dog.addFirst("feifei:Dog");

        String dogFirst=(String) dog.getFirst();//获取第一条狗狗
        System.out.println("第一条狗是："+dogFirst);

        String dogLast=(String) dog.getLast();//获取第一条狗狗
        System.out.println("最后一条狗是："+dogLast);

        dog.removeFirst();//删除第一条狗狗
        dog.removeFirst();//删除最后一条狗

        System.out.println(dog);
    }
}
